package com.wicket.okrcomponent.web.contorller;

import com.github.pagehelper.Page;
import com.wicket.okrcomponent.biz.service.TemplateEngineService;
import com.wicket.okrcomponent.biz.service.dto.req.*;
import com.wicket.okrcomponent.biz.service.dto.res.*;
import com.wicket.okrcomponent.common.ro.OkrResult;
import com.wicket.okrcomponent.common.util.CommonFunctionHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@RestController
@RequestMapping("/comp/templateEngine/")
public class TemplateEngineController {

    @Autowired
    TemplateEngineService templateEngineService;

    /**
   * D2-8查询语义引擎详情
   */
    @PostMapping("querySemanticEngineDetail")
    public OkrResult<QuerySemanticEngineDetailRespDto> querySemanticEngineDetail(@RequestBody @Validated QuerySemanticEngineDetailReqDto reqDTO){
    return OkrResult.success(templateEngineService.querySemanticEngineDetail(reqDTO));
    }

    /**
   * D2-8查语义引擎列表
   */
    @PostMapping("querySemanticEngineList")
    public OkrResult<QuerySemanticEngineListRespDto> querySemanticEngineList(@RequestBody @Validated QuerySemanticEngineListReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QuerySemanticEngineListRespDto retData = templateEngineService.querySemanticEngineList(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }

    /**
   * D2-8修改语义引擎
   */
    @PostMapping("updateSemanticEngine")
    public OkrResult<UpdateSemanticEngineRespDto> updateSemanticEngine(@RequestBody @Validated UpdateSemanticEngineReqDto reqDTO){
    return OkrResult.success(templateEngineService.updateSemanticEngine(reqDTO));
    }

    /**
   * D2-8新增语义引擎
   */
    @PostMapping("addSemanticEngine")
    public OkrResult<AddSemanticEngineRespDto> addSemanticEngine(@RequestBody @Validated AddSemanticEngineReqDto reqDTO){
    return OkrResult.success(templateEngineService.addSemanticEngine(reqDTO));
    }
/**
   * D2生成时间周期等语义内容服务(公共)
   */
    @PostMapping("generateTimeCycleEtcSemanticInstanceCom")
    public OkrResult<GenerateTimeCycleEtcSemanticInstanceComRespDto> generateTimeCycleEtcSemanticInstanceCom(@RequestBody @Validated GenerateTimeCycleEtcSemanticInstanceComReqDto reqDTO){
    return OkrResult.success(templateEngineService.generateTimeCycleEtcSemanticInstanceCom(reqDTO));
    }
/**
   * D2生成批次名称等语义内容服务(公共)
   */
    @PostMapping("generateBatchNameEtcSemanticInstanceCom")
    public OkrResult<GenerateBatchNameEtcSemanticInstanceComRespDto> generateBatchNameEtcSemanticInstanceCom(@RequestBody @Validated GenerateBatchNameEtcSemanticInstanceComReqDto reqDTO){
    return OkrResult.success(templateEngineService.generateBatchNameEtcSemanticInstanceCom(reqDTO));
    }
/**
   * D2-生成定时调度任务语义实例(公共)
   */
    @PostMapping("generateTimingDispatchTaskSemanticInstanceCom")
    public OkrResult<GenerateTimingDispatchTaskSemanticInstanceComRespDto> generateTimingDispatchTaskSemanticInstanceCom(@RequestBody @Validated GenerateTimingDispatchTaskSemanticInstanceComReqDto reqDTO){
    return OkrResult.success(templateEngineService.generateTimingDispatchTaskSemanticInstanceCom(reqDTO));
    }
/**
   * D2生成对象校验语义实例(公共)
   */
    @PostMapping("generateObjectCheckSemanticInstanceCom")
    public OkrResult<GenerateObjectCheckSemanticInstanceComRespDto> generateObjectCheckSemanticInstanceCom(@RequestBody @Validated GenerateObjectCheckSemanticInstanceComReqDto reqDTO){
    return OkrResult.success(templateEngineService.generateObjectCheckSemanticInstanceCom(reqDTO));
    }
/**
   * D2生成消息语义实例(公共)
   */
    @PostMapping("generateMessageSemanticInstanceCom")
    public OkrResult<GenerateMessageSemanticInstanceComRespDto> generateMessageSemanticInstanceCom(@RequestBody @Validated GenerateMessageSemanticInstanceComReqDto reqDTO){
    return OkrResult.success(templateEngineService.generateMessageSemanticInstanceCom(reqDTO));
    }
/**
   * D2获取分布式锁语义实例(公共)
   */
    @PostMapping("obtainLockSemanticInstanceCom")
    public OkrResult<ObtainLockSemanticInstanceComRespDto> obtainLockSemanticInstanceCom(@RequestBody @Validated ObtainLockSemanticInstanceComReqDto reqDTO){
    return OkrResult.success(templateEngineService.obtainLockSemanticInstanceCom(reqDTO));
    }
/**
   * D2生成第三方问答问题语义实例(公共)
   */
    @PostMapping("generateThirdPartyIntelligentQaSemanticInstanceCom")
    public OkrResult<GenerateThirdPartyIntelligentQaSemanticInstanceComRespDto> generateThirdPartyIntelligentQaSemanticInstanceCom(@RequestBody @Validated GenerateThirdPartyIntelligentQaSemanticInstanceComReqDto reqDTO){
    return OkrResult.success(templateEngineService.generateThirdPartyIntelligentQaSemanticInstanceCom(reqDTO));
    }
/**
   * D2生成消息标题及内容语义实例(公共)
   */
    @PostMapping("generateMsgTitleAndContentSemanticInstanceCom")
    public OkrResult<GenerateMsgTitleAndContentSemanticInstanceComRespDto> generateMsgTitleAndContentSemanticInstanceCom(@RequestBody @Validated GenerateMsgTitleAndContentSemanticInstanceComReqDto reqDTO){
    return OkrResult.success(templateEngineService.generateMsgTitleAndContentSemanticInstanceCom(reqDTO));
    }
/**
   * D2生成消息标题及内容(公共)
   */
    @PostMapping("generateMsgTitleAndContentCom")
    public OkrResult<GenerateMsgTitleAndContentComRespDto> generateMsgTitleAndContentCom(@RequestBody @Validated GenerateMsgTitleAndContentComReqDto reqDTO){
    return OkrResult.success(templateEngineService.generateMsgTitleAndContentCom(reqDTO));
    }
/**
   * D2生成账单流水业务故事(公共)
   */
    @PostMapping("generateBillStreamBizStoryCom")
    public OkrResult<GenerateBillStreamBizStoryComRespDto> generateBillStreamBizStoryCom(@RequestBody @Validated GenerateBillStreamBizStoryComReqDto reqDTO){
    return OkrResult.success(templateEngineService.generateBillStreamBizStoryCom(reqDTO));
    }
/**
   * D2-生成时长文案语义实例(公共)
   */
    @PostMapping("generateDurationTextSemanticInstanceCom")
    public OkrResult<GenerateDurationTextSemanticInstanceComRespDto> generateDurationTextSemanticInstanceCom(@RequestBody @Validated GenerateDurationTextSemanticInstanceComReqDto reqDTO){
    return OkrResult.success(templateEngineService.generateDurationTextSemanticInstanceCom(reqDTO));
    }
/**
   * D2执行机器人场景语义实例(公共)
   */
    @PostMapping("implementRoboticSceneSemanticEngineCom")
    public OkrResult<ImplementRoboticSceneSemanticEngineComRespDto> implementRoboticSceneSemanticEngineCom(@RequestBody @Validated ImplementRoboticSceneSemanticEngineComReqDto reqDTO){
    return OkrResult.success(templateEngineService.implementRoboticSceneSemanticEngineCom(reqDTO));
    }
/**
   * D2生成语义实例故事(公共)
   */
    @PostMapping("generateSemanticInstanceStoryCom")
    public OkrResult<GenerateSemanticInstanceStoryComRespDto> generateSemanticInstanceStoryCom(@RequestBody @Validated GenerateSemanticInstanceStoryComReqDto reqDTO){
    return OkrResult.success(templateEngineService.generateSemanticInstanceStoryCom(reqDTO));
    }
/**
   * D2查询语义引擎详情(公共)
   */
    @PostMapping("querySemanticEngineDetailCom")
    public OkrResult<QuerySemanticEngineDetailComRespDto> querySemanticEngineDetailCom(@RequestBody @Validated QuerySemanticEngineDetailComReqDto reqDTO){
    return OkrResult.success(templateEngineService.querySemanticEngineDetailCom(reqDTO));
    }
/**
   * D2生成语义实例(公共)
   */
    @PostMapping("generateSemanticInstanceCom")
    public OkrResult<GenerateSemanticInstanceComRespDto> generateSemanticInstanceCom(@RequestBody @Validated GenerateSemanticInstanceComReqDto reqDTO){
    return OkrResult.success(templateEngineService.generateSemanticInstanceCom(reqDTO));
    }
/**
   * D2分析账单流水业务故事(公共)
   */
    @PostMapping("analysisBillStreamBizStoryCom")
    public OkrResult<AnalysisBillStreamBizStoryComRespDto> analysisBillStreamBizStoryCom(@RequestBody @Validated AnalysisBillStreamBizStoryComReqDto reqDTO){
    return OkrResult.success(templateEngineService.analysisBillStreamBizStoryCom(reqDTO));
    }

}
